Skip to content

avm2: Fix stack trace for context3DCreated event handler#23745

Merged
kjarosh merged 2 commits into
ruffle-rs:masterfrom
Lord-McSweeney:avm2-fix-context3d-stack
May 22, 2026
Merged

avm2: Fix stack trace for context3DCreated event handler#23745
kjarosh merged 2 commits into
ruffle-rs:masterfrom
Lord-McSweeney:avm2-fix-context3d-stack

Conversation

@Lord-McSweeney
Copy link
Copy Markdown
Collaborator

@Lord-McSweeney Lord-McSweeney commented May 18, 2026

Description

This PR fixes the stack trace for the context3DCreated event handler. Previously, the event was manually dispatched from AS with a delay. Now, we set some state on the Stage3DObject, which is updated by code in the Stage display object at the beginning of the AVM2 frame lifecycle.

With the previous approach, the stack trace for the failing test avm2/stage3d_agal_upload_errors would have to be updated every time the total function count changed in our playerglobals.

Testing

I've marked the avm2/stage3d_agal_upload_errors test as passing and added a new test, avm2/context3d_creation.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

@Lord-McSweeney Lord-McSweeney added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player labels May 18, 2026
@Lord-McSweeney Lord-McSweeney force-pushed the avm2-fix-context3d-stack branch 2 times, most recently from 38edc3c to 8f09f78 Compare May 18, 2026 23:51
@Lord-McSweeney Lord-McSweeney added the waiting-on-review Waiting on review from a Ruffle team member label May 18, 2026
@kjarosh kjarosh removed the waiting-on-review Waiting on review from a Ruffle team member label May 22, 2026
@kjarosh kjarosh force-pushed the avm2-fix-context3d-stack branch from 8f09f78 to e61afca Compare May 22, 2026 19:06
@kjarosh kjarosh enabled auto-merge (rebase) May 22, 2026 19:06
Previously, the asynchronicity of context3d creation was implemented entirely
in AS using setTimeout. This added extra methods to the stack trace.
Asynchronicity for context3D creation is now handled entirely in Rust.
This removes extra methods from the stack trace from inside the event handler.
@Lord-McSweeney Lord-McSweeney force-pushed the avm2-fix-context3d-stack branch from e61afca to b1916d0 Compare May 22, 2026 19:14
@kjarosh kjarosh merged commit b95f757 into ruffle-rs:master May 22, 2026
26 checks passed
Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request May 23, 2026
-----------------------------------------------------------------------------------
cemu.mk ca15637b6378a2c8424a4be8919aabb8c87992ce # Version: Commits on May 22, 2026
-----------------------------------------------------------------------------------
UI: Fix formatting error in TextureRelationWindow (#1926),

------------------------------------------------------------------------------------------
duckstation.mk fc72f17a5ceb0fe5d453789b6b5775fc5ff1c99c # Version: Commits on May 23, 2026
------------------------------------------------------------------------------------------
CI: Drop unused input (#3743)

actions/upload-artifact ignores the name input when using `archive: false`,

-----------------------------------------------------------------------------------
eden.mk 83683440b24c2d07536fddf2faa77c000c14374b # Version: Commits on May 22, 2026
-----------------------------------------------------------------------------------
[net] ban api.epicgames.dev domain (#3999)

--------------------------------------------------------------------------------------
flycast.mk bb304918f8d9f1d2c1e80ccabfa86806ef70bcfa # Version: Commits on May 22, 2026
--------------------------------------------------------------------------------------
Fetch translations & Recreate libretro_core_options_intl.h,

-----------------------------------------------------------------------------------
play.mk ba4c1f4d59a363819237574c1edfbfe53705072f # Version: Commits on May 20, 2026
-----------------------------------------------------------------------------------
Android: Replace migration logic with import/export logic.,

-----------------------------------------------------
ryujinx.mk 1.3.299 # Version: Commits on May 22, 2026
-----------------------------------------------------
1.3.299

---------------------------------------------------------------------------------------
touchhle.mk 40ab5aae95db6d909e31f0a202e6d19b35655680 # Version: Commits on Jul 26, 2025
---------------------------------------------------------------------------------------
CGImageCreate() for the case of XRGB in 32 little endian

Change-Id: Icad59ef03a562b89f1e6905da8837272c671abf8,

--------------------------------------------------------------------------------------
tsugaru.mk 286b6c057e19b68209ed8c64d8a82581816b0998 # Version: Commits on May 22, 2026
--------------------------------------------------------------------------------------
Cleaning,

-----------------------------------------------------------------------------------------
xenia-edge.mk 882cd7e9171a713a011f6ac0dd9c2bf6979eb4f7 # Version: Commits on May 23, 2026
-----------------------------------------------------------------------------------------
[App] Implement game library storage separate from dash GPD

Original implementation overloaded dash gpd for each profile in order to

store game library data, including launch paths, disc labels etc.

This created some hairy code to deal with various edge cases and still

allowed for unusual interactions to blow away a user's profile settings.

This moves that into separate storage in storage_root/library/ that

mirrors content/ in some sense and maintains per title data like launch

path, icon, and maybe artwork etc in the future, in a location that's

not fundamentally tied to profiles, making the code more straightfoward

and potential for corrupting profiles/library data greatly reduced if

not completely eliminated.,

---------------------------------------------------------------
ruffle.mk nightly-2026-05-23 # Version: Commits on May 23, 2026
---------------------------------------------------------------
## What's Changed

* chore: Bump eslint-plugin-jsdoc from 62.9.0 to 63.0.0 in /web by @dependabot[bot] in ruffle-rs/ruffle#23781

* chore: Bump the npm-minor group across 1 directory with 7 updates by @dependabot[bot] in ruffle-rs/ruffle#23779

* chore: Fix a bunch of typos (mostly in comments) by @torokati44 in ruffle-rs/ruffle#23782

* chore: Bump qs and express in /web by @dependabot[bot] in ruffle-rs/ruffle#23784

* avm2: Fix stack trace for context3DCreated event handler by @Lord-McSweeney in ruffle-rs/ruffle#23745

* avm2: Verify that lazy namespace is actually a Namespace in the verifier by @Lord-McSweeney in ruffle-rs/ruffle#23777

**Full Changelog**: ruffle-rs/ruffle@nightly-2026-05-22...nightly-2026-05-23,

---------------------------------------------------------------------------------------
thextech.mk 6bd0b7350bde280e24553091a63621aabf7e8dc6 # Version: Commits on May 22, 2026
---------------------------------------------------------------------------------------
Updated AudioCodecs and MixerX,

----------------------------------------------------------------------------------------------------
gamenetworkingsockets.mk b88a52c2065824d5425ecbba07881e57e16c0c16 # Version: Commits on May 23, 2026
----------------------------------------------------------------------------------------------------
Fix dangling pointer bug

If there is more than one STUN server and the name is

shorter than std::string small string optimization size.,

------------------------------------------------------------------------------------------------
libretro-mame-src.mk eaa63ea220874f70adce2e5afccd7509516fbf0a # Version: Commits on May 23, 2026
------------------------------------------------------------------------------------------------
Merge remote-tracking branch 'upstream/master',

----------------------------------------------------------------------------------------
retroarch.mk dc3cef4545ec3dd19887c18df5e01ac0478237c2 # Version: Commits on May 23, 2026
----------------------------------------------------------------------------------------
Fetch translations from Crowdin,

---------------------------------------------------------------------------------------
vpinball.mk bd65c64fe04b41f2ecfdb00ecdc6aef1eaf05706 # Version: Commits on May 22, 2026
---------------------------------------------------------------------------------------
pup: render ForcePop screens and keep labels on same-page show (#3429),

----------------------------------------------------------------------------------------
doomretro.mk 8e3a2551e8e4c186f739bf2a7fd13ae4aa45e0b7 # Version: Commits on May 23, 2026
----------------------------------------------------------------------------------------
Improvements to updating expansion

Fixes updating `expansion` CVAR during intermission causing next map to be opened from different expansion,

--------------------------------------------------------------------------------------
vkquake.mk b743a8fc024a98a2da2192225710e3443eed88f3 # Version: Commits on May 18, 2026
--------------------------------------------------------------------------------------
r_world.c : Split work again by a small factor (MARK_SURFACE_CALLS_PER_WORKER),

------------------------------------------------------------------------------------------
xash3d-fwgs.mk 25ca2ecb121810c0d3c241bd211cc9e64fa335fa # Version: Commits on May 22, 2026
------------------------------------------------------------------------------------------
engine: fix Netchan_Validate units bug allowing oversized fragments,

---------------------------------------------------------------------------------------------
libretro-fbneo.mk ebee599355682000d25eb041601c00f07fbeae10 # Version: Commits on May 23, 2026
---------------------------------------------------------------------------------------------
(libretro) update files,

-----------------------------------------------------------------------------------------------
libretro-flycast.mk bb304918f8d9f1d2c1e80ccabfa86806ef70bcfa # Version: Commits on May 22, 2026
-----------------------------------------------------------------------------------------------
Fetch translations & Recreate libretro_core_options_intl.h,

--------------------------------------------------------------------------------------------------
libretro-gearcoleco.mk 6a9a99f78e398e5d679773d9cf97e415e9526dc0 # Version: Commits on May 22, 2026
--------------------------------------------------------------------------------------------------
Align fullscreen feature implementation,

-------------------------------------------------------------------------------------------------
libretro-geargrafx.mk 87093ae372d5134a0bba2d759cb17d10262e0bcc # Version: Commits on May 23, 2026
-------------------------------------------------------------------------------------------------
Improve CD seek timing,

--------------------------------------------------------------------------------------------------
libretro-gearsystem.mk 0efba78ce74b6e1440734084627d3739dd2f99f3 # Version: Commits on May 22, 2026
--------------------------------------------------------------------------------------------------
Align fullscreen feature implementation,

-----------------------------------------------------------------------------------------------------
libretro-mame2003-plus.mk 0191984c9e92482f15536135de9baeff082be63e # Version: Commits on May 22, 2026
-----------------------------------------------------------------------------------------------------
Add support for 16KB pages on Android. (#2019),

----------------------------------------------------------------------------------------------
libretro-stella.mk a9affd080f2768942e7511b62030e72d27ab52b0 # Version: Commits on May 23, 2026
----------------------------------------------------------------------------------------------
And another TODO I missed.,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants